#ifndef LINEITEM_H
#define LINEITEM_H

#include "ShapeItem.h"

class LineItem : public ShapeItem
{
    Q_OBJECT
    Q_PROPERTY(QPointF p1 READ p1 WRITE setP1 NOTIFY p1Changed)
    Q_PROPERTY(QPointF p2 READ p2 WRITE setP2 NOTIFY p2Changed)
public:
    explicit LineItem(QQuickItem *parent = 0);

    QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);

    QPointF p1() const { return m_p1; }
    QPointF p2() const { return m_p2; }

    void setP1(const QPointF &p);
    void setP2(const QPointF &p);
    
    virtual Type shapeType() const { return ShapeItem::Line; }
signals:
    void p1Changed(const QPointF &p);
    void p2Changed(const QPointF &p);
private:
    QPointF m_p1;
    QPointF m_p2;
    
};

#endif // LINEITEM_H
